package com.example.demo.controller;

import com.alibaba.fastjson.JSON;
import com.example.demo.domain.UrUser;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloWorldController {

    @RequestMapping("/hello")
    public String helloWorld(String name) {
        UrUser urUser = new UrUser();
        if (null != name) {
            urUser.setName(name);
        } else {
            urUser.setName("刘冬奎");
        }
        urUser.setAge(32);
        urUser.setSex("男");
        return JSON.toJSONString(urUser);
    }
}
